/*
 * @Author: szx
 * @Date: 2022-03-22 12:41:31
 * @LastEditTime: 2022-03-22 12:50:14
 * @Description:
 * @FilePath: \leetcode\2000-2099\2038\2038.js
 */
/**
 * @param {string} colors
 * @return {boolean}
 */
var winnerOfGame = function (colors) {
    let cntA = 0;
    let cntB = 0;
    for (let i = 1; i < colors.length - 1; i++) {
        if (colors[i] == colors[i - 1] && colors[i] == colors[i + 1]) {
            if (colors[i] == 'A') cntA++;
            if (colors[i] == 'B') cntB++;
        }
    }
    return cntA > cntB ? true : false;
};
